<template>
  <div class="role-list">
    <Permission permission="role:create">
      <el-button type="primary" @click="handleCreate">
        创建角色
      </el-button>
    </Permission>
    
    <el-table :data="roleList">
      <el-table-column prop="roleName" label="角色名称" />
      <el-table-column prop="roleCode" label="角色编码" />
      <el-table-column label="操作">
        <template #default="{ row }">
          <Permission permission="role:edit">
            <el-button type="primary" @click="handleEdit(row)">
              编辑
            </el-button>
          </Permission>
          <Permission permission="role:delete">
            <el-button type="danger" @click="handleDelete(row)">
              删除
            </el-button>
          </Permission>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template> 